package top.littlejiang.onlinexam.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.multipart.MultipartFile;
import top.littlejiang.onlinexam.common.base.BasePage;
import top.littlejiang.onlinexam.entity.OlexamQuestions;
import top.littlejiang.onlinexam.common.base.BaseService;
import top.littlejiang.onlinexam.vo.QuestionQueryVO;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 题目表 服务类
 * </p>
 *
 * @author chen
 * @since 2021-03-11
 */
public interface OlexamQuestionsService extends BaseService<OlexamQuestions> {

    /**
     * 分页查询
     * @param page
     * @return
     */
    IPage<OlexamQuestions> getQuestionListPage(BasePage<QuestionQueryVO> page);

    /**
     * 保存或更新题目
     * @param question
     * @param files
     */
    void insertOrUpdate(OlexamQuestions question, MultipartFile[] files);

    /**
     * 根据条件查询所有内容
     * @param queryVO
     * @return
     */
    List<OlexamQuestions> queryAll(QuestionQueryVO queryVO);

    /**
     * 根据id 获取详情
     * @param ids
     * @param withAnswer
     * @return
     */
    List<OlexamQuestions> selectInIds(List<Serializable> ids, boolean withAnswer);
}
